To split on the first occurrence using regex in PowerShell, you can use the -split operator along with a regular expression pattern that matches the first occurrence. For example, if you want to split a string $input on the first comma ,, you can do it like this:
$input = "first,second,third"
$parts = $input -split ",(?=.*?,)"
In this example, the regex pattern ",(?=.*?,)" matches the first comma , in the string without consuming any characters after it. The (?=.*.